package com.champ.thread.yield;

public class YieldThread extends Thread{

	@Override
	public void run() {
		long beginTime = System.currentTimeMillis();
		int cout = 0;
		for (int i = 0; i < 5000000; i++) {
			Thread.yield();
			cout = cout+(i+1);
		}
		long endTime = System.currentTimeMillis();
		System.out.println("time: " + (endTime-beginTime)+ "毫秒");
	}
}
